//
//  GoodsListEntity.swift
//  APPCore
//
//  Created by raymond Peng on 2018/8/7.
//  Copyright © 2018 TanBaYe. All rights reserved.
//

import Foundation
import Domain

/// 商城数据的顶层实体
struct GoodsListEntity: Decodable {
    let categories: [GoodsCategory]?   // 产品分类
    let products: [ProductEntity]?     // 产品内容
}

extension GoodsListEntity: IShoppingDataListEntity {
    var categoryArray: [ICategoryEntity] {
        return categories ?? []
    }

    var productArray: [IProductEntity] {
        return products ?? []
    }
}
